package com.jingtai.platform.controller.supply;

import com.jingtai.core.entity.BaseEntity;
import com.jingtai.core.entity.supply.SupplyToPlatformApply;
import com.jingtai.platform.service.supply.SupplyToPlatformApplyService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 供应商向平台入驻申请表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:31
 */
@Validated
@RestController
@RequestMapping("/platform/supplytoplatformapply")
@Api(tags = "供应商向平台入驻申请表")
public class SupplyToPlatformApplyController{

    @Autowired
    private SupplyToPlatformApplyService supplyToPlatformApplyService;


    @ApiOperation("供应商向平台入驻申请表列表查询")
    @GetMapping("/list")
    public ResultUtil aopSupplyToPlatformApplyList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return supplyToPlatformApplyService.SupplyToPlatformApplylist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询supplyToPlatformApply实体")
    @GetMapping("/getSupplyToPlatformApplyById")
    public ResultUtil GetSupplyToPlatformApplyById(@CApiParam(name = "id",value = "supplyToPlatformApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return supplyToPlatformApplyService.getSupplyToPlatformApplyById(id);
    }


    @ApiOperation("新增supplyToPlatformApply实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"supplyToPlatformApply.id","supplyToPlatformApply.createTime","supplyToPlatformApply.updateTime","supplyToPlatformApply.deleteFlag"})
    public ResultUtil aopAddSupplyToPlatformApply(@RequestBody @Validated({BaseEntity.Create.class}) SupplyToPlatformApply supplyToPlatformApply){
        return supplyToPlatformApplyService.addSupplyToPlatformApply(supplyToPlatformApply);
    }

    @ApiOperation("编辑supplyToPlatformApply实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"supplyToPlatformApply.createTime","supplyToPlatformApply.updateTime","supplyToPlatformApply.deleteFlag"})
    public ResultUtil aopEditSupplyToPlatformApply(@RequestBody @Validated({BaseEntity.Update.class}) SupplyToPlatformApply supplyToPlatformApply){
        return supplyToPlatformApplyService.editSupplyToPlatformApply(supplyToPlatformApply);
    }

    @ApiOperation("根据ID删除supplyToPlatformApply实体")
    @GetMapping("/delSupplyToPlatformApplyById")
    public ResultUtil aopDelSupplyToPlatformApplyById(@CApiParam(name = "id",value = "supplyToPlatformApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return supplyToPlatformApplyService.delSupplyToPlatformApplyById(id);
    }

}






